The present invention relates in general to methods for computer low power modes and, in particular, to entering and exiting computer low power modes. Still more particularly, the present invention relates to optimizing the speed at which computer low power modes are entered and exited.
Various types of low power modes are incorporated into computer systems which utilize a hibernation mode, commonly known as xe2x80x9csleepxe2x80x9d mode or low power mode where power sources to internal components, such as main memory, are essentially disabled to conserve power during periods of non-use.
Prior art methods commonly save the contents of main memory on a hard disk drive prior to entering hibernation mode. Known methods for enhancing performance include compressing the memory contents prior to storing on the hard disk drive as a file and then reading and decompressing the file containing the memory contents when hibernation mode is exited. The compression of the file may result in a significantly smaller file, which in some situations will reduce the transfer time to and from the hard disk drive. However, when the reduction in the size of the file is small, the time to execute compression and decompression may take more time then is saved by having a smaller sized file. For this reason, conventional methods commonly specify a minimal reduction in size, usually in terms of a percentage of the original file size, which must be achieved before file compression is used. Commonly, an evaluation is made each time hibernation mode is exited (i.e. wake-up) of whether the actual reduction in size is greater then the minimal specified amount to determine whether compression takes place the next time hibernation mode is entered.
FIG. 3 shows a flow chart for explaining this prior art method. An area is reserved on the hard disk drive (step S21). The first time hibernation mode is entered, a file containing the contents of memory, including video memory, is compressed (step S22). The size of the file before compression C1 and after compression C2 is determined in step S23. Hibernation mode is entered and power to main memory and VRAM is disabled in step S24. At a latter time, the computer wakes-up in step S25: power is restored to internal circuits, and the computer returns to normal operation. The next time hibernation mode is about to be entered, the ratio of the difference between the size of memory contents before compression C1 and after compression C2 to the size of the memory content C1 is compared to a specified value X. When the ratio ((C1xe2x88x92C2)/C1) is greater then the specified minimum value X, the memory contents are compressed prior to the next time hibernation mode is entered. Otherwise, when the ratio ((C1xe2x88x92C2)/C1) is equal or smaller then the specified minimum value X, compression does not take place prior to next time hibernation mode is entered.
The minimal value X is fixed for a particular system and is typically selected based on the performance of the CPU, memory, and hard disk drive. Changes in components and in the system environment that effect a computer system""s speed can result in the specified fixed minimal value X no longer providing an accurate indicator of when compression accelerates or decelerates the transitions in and out of hibernation mode. As the speed of computer components continues to advance, the ability to maintain an accurate value for X becomes more difficult when components are changed.
A method is needed that determines the specified minimum value X based on actual system performance and automatically updates the minimum value X to comprehend changes in a computer""s components that effect speed.
The methods of the present invention determine, based on actual performance, the amount of data compression required for the compression to accelerate the processes for entering and exiting hibernation mode.
A method for managing a computer hibernation mode, where in response to a request to enter a hibernation mode, the contents of a memory are compressed and stored to a non-volatile storage, such as a hard disk drive. Hibernation mode is entered in which power is disabled to memory. After hibernation mode is exited and power is enabled to memory, the contents of memory are read from the non-volatile storage and decompressed. An evaluation is made, based on actual performance, whether the compression and decompression provided for increased performance and a determination is made, according to said evaluation results the next-time in which a hibernation request is made, whether to compress the memory contents prior to saving on the hard disk drive
The contents of a video memory as well as main memory may be stored on the hard disk drive, while the system is in hibernation mode.
The evaluation may include measuring the actual rate in which data is read from the non-volatile storage. An equation may be utilized for the evaluation: Yxe2x88x92(BX)/A less than C/(XA), where Y is time to read and decompress a file comprising said stored contents of said memory, B is the size of said file after compression, X/A is the measured rate at which data is read from said non-volatile storage device, and C is the difference between said file before compression and said file after compression.